package com.xiaoyu.awakening.base.api;

import com.xiaoyu.awakening.base.entity.dto.OSMetadataResponse;
import com.xiaoyu.awakening.common.core.dto.Result;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件上传服务
 *
 * @author wangxiaoyu
 * @since v1.0
 */
@RequestMapping("/api/v1/osFile")
@Schema(name = "对象文件管理模块")
public interface IObjectStorageControllerApi {
    @PostMapping("/upload")
    Result<OSMetadataResponse> uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(required = false) Integer storageType);

    @PostMapping("/delete")
    Result<Boolean> deleteFile(@RequestParam("file") MultipartFile file, @RequestParam(required = false) Integer storageType);

    @GetMapping("/{fileId}")
    Result<OSMetadataResponse> metadata(@PathVariable(name = "fileId") String fileId);

}
